$(function(){
    // 图表父容器一
    var myChart1 = echarts.init(document.getElementById('c1'));
    var option1 = {
        title: {
            text: '2020年注册人数'
        },
        tooltip: {},
        legend: {
            data: ['销量', '人数']
        },
        xAxis: {
            data:['一月','二月','三月','四月','五月','六月']
        },
        yAxis: {},
        series: [
            {
                name: '销量',
                type: 'bar',
                data: [5,20,56,10,10,20]
            },
            {
                name: '人数',
                type: 'line',
                data: [25,10,30,60,20,50]
            }
        ]
    };
    myChart1.setOption(option1);

    // 图表二
    var myChart2 = echarts.init(document.getElementById('c2'));
    var option2 = {
        tooltip: {
            trigger: 'item',
            formatter: "{a}<br/>{b}: {c} ({d}%"
        },
        legend: {
            left: "right",
            orient: 'vertical',
            x: 'left',
            data: ['阿迪','解放','老北京','回力','双星']
        },
        series: [
            {
                name: '热销品牌',
                type: 'pie',
                radius: ['50%', '70%'],
                avoidLabelOverlap: false,
                label: {
                    normal: {
                        show: false,
                        postion: 'center'
                    },
                    emphasis: {
                        show: true,
                        textStyle: {
                            fontSize: '30',
                            fontWeight: 'bold'
                        }
                    },
                },
                labelLine : {
                    normal: {
                        show: false,
                    }
                },
                data: [
                    {
                        value: 335, name: '阿迪'
                    },
                    {
                        value: 310, name: '解放'
                    },
                    {
                        value: 234, name: '老北京'
                    },
                    {
                        value: 135, name: '回力'
                    },
                    {
                        value: 1548, name: '双星'
                    },
                ]

            }
        ],
    };
    myChart2.setOption(option2);
})